<template>
  <div>
    <h2>当前计数: {{ $store.state.counter }}</h2>
    <hr />
    <button @click="incrementAction">+1</button>
    <button @click="add">+1</button>
    <hr />
  </div>
</template>

<script>
import { mapActions } from "vuex";

export default {
  methods: {
    // ...mapActions(["incrementAction"]),
    // ...mapActions({
    //   add: "incrementAction",
    // }),
  },
  setup() {
    const actions = mapActions(["incrementAction"]);
    return {...actions}
  },
};
</script>

<style scoped></style>
